<template>
  <div>
    <header class="header">
      <section class="header-top">
        <div class="left" v-if="goBack" @click="$router.go(-1)">
          <img src="./images/fanhui@2x.png" alt="">
        </div>
        <div class="title" v-if="headTitle">
          <span>{{headTitle}}</span>
        </div>
        <div class="right" v-if="hidden">
          <img src="./images/xialajiantou@2x.png" alt="">
        </div>
        <div class="right text" v-if="rightTitle" @click="goDetail">
          <span>{{rightTitle}}</span>
        </div>
        <div class="right text" v-if="btnSubmit">
          <span>{{btnSubmit}}</span>
        </div>
      </section>
    </header>
  </div>
</template>
<style lang="scss">
.header {
  top: 0;
  right: 0;
  left: 0;
  position: fixed;
  z-index: 1;
  height: 40px;
  line-height: 40px;
  background-color: #0B7AD9;
  .header-top {
    position: relative;
    .title {
      text-align: center;
      font-size: 17px;
      color: #fff;
    }
    .left {
      position: absolute;
      top: 0;
      left: 10px;
      img {
        width: 9px;
        height: 16px;
        font-size: 0;
        vertical-align: middle;
      }
    }
    .right {
      position: absolute;
      top: 0;
      right: 10px;
      img {
        height: 9px;
        width: 16px;
        font-size: 0;
        vertical-align: middle;
      }
    }
    .text {
        font-size: 15px;
        color: #fff;        
      }
  }
}
</style>
<script>
export default {
  data () {
    return {
    }
  },
  methods: {
    goDetail (e) {
      this.$emit('detail', e.target)
    }
  },
  props: ['headTitle', 'goBack', 'hidden', 'rightTitle', 'btnSubmit']
}
</script>
